cmake_minimum_required(VERSION 3.8)
project(string_configure)

set(PI 3.1415926)
string(CONFIGURE "@PI@ ${PI}" out1)
message(STATUS "out1 -- ${out1}")

string(CONFIGURE "#cmakedefine PI 3.1415926" out2)
message(STATUS "out2 -- ${out2}")

set(LANG "CMake")
set(NEWLANG "JAVA")
string(CONFIGURE "#cmakedefine LANG \"@LANG@\"\n#cmakedefine NEWLANG \"${NEWLANG}\"" out3 @ONLY)
message(STATUS "out3 -- ${out3}")

set(Book "\"C++\"")
string(CONFIGURE "#cmakedefine Book \"@Book@\"" out4)
message(STATUS "out4 -- ${out4}")
string(CONFIGURE "#cmakedefine Book \"@Book@\"" out5 ESCAPE_QUOTES)
message(STATUS "out5 -- ${out5}")
